'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  up: (queryInterface, Sequelize) => {
    const { INTEGER, STRING, DATE, ENUM, TEXT } = Sequelize;
    return queryInterface.createTable("slide", {
      id: {
        type: INTEGER(20),
        primaryKey: true,
        autoIncrement: true,
      },
      title: {
        type: STRING(30),
        allowNull: false,
        defaultValue: '',
        comment: "标题",
      },
      images: {
        type: STRING(90),
        allowNull: false,
        defaultValue: '',
        comment: "图片",
      },
      link: {
        type: STRING(30),
        allowNull: true,
        defaultValue: "",
        comment: "链接",
      },
      order: {
        type: INTEGER(60),
        allowNull: true,
        defaultValue: 0,
        comment: "排序",
      },
      status: {
        type: INTEGER(1),
        allowNull: false,
        defaultValue: 1,
        comment: "状态 0禁用 1启用",
      }, 
      created_time: DATE,
      updated_time: DATE,
    });
  },

  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable("slide");
  },
};
